package com.waitingresult.thread;

/**
 * All right reserved,Designed By WangShuai
 *
 * @author : WangShuai
 * @version : V1.0
 * @ClassName : Abc123Demo
 * @Description :  Abc123Demo 交替打印
 * @date : 2022/9/16 15:25
 */
public class Abc123Demo {
    private  static Thread t1 ,t2 = null;
    public static void main(String[] args) {
        char[] a1 = "1234567".toCharArray();
        char[] aI = "ABCDEFG".toCharArray();
//        t1 =  new Thread(()->{
//            for (char c : a1) {
//                System.err.print(c);
//                LockSupport.unpark(t2);
//                LockSupport.park();
//            }
//        },"T1");
        t2 =  new Thread(()->{
            for (char c : aI) {
             //   LockSupport.park();
                System.err.print(c);
               // LockSupport.unpark(t1);
            }
        },"T2");
//        t1.start();
//        t2.start();
        t2.start();
        t2.start();
    }
}
